<template>
  <component :is="iconComponent"/>
</template>

<script lang="ts" setup>
import * as AntdIcon from '@ant-design/icons-vue'
import { computed } from 'vue'
const props = defineProps({
  type: {
    type: String,
    required: true
  }
})
const iconComponent = computed(() => {
  const arr = [
    ...props.type.split('-'),
    'outlined'
  ]
  const iconName = arr.map(item => item[0].toUpperCase() + item.slice(1)).join('')
  return AntdIcon[iconName]
})
</script>

<style scoped>

</style>
